import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Main2 main2 = new Main2();
        Scanner scan = new Scanner(System.in);
        int number = scan.nextInt();
        System.out.println(main2.isPrimeNumber(number));
    }

    public Boolean isPrimeNumber(int number) {

        //write your code here......
        if(number!=2&&number%2==0)return false;
        for (int i = 3; i < number; i++) {
            if(number%i==0){
                return false;
            }
        }return true;
    }
}